import * as home from './action-type';

// 全局数据1
let defaultStateCommonData1 = {
	msg1: '11', //金额
	msg2: '22', //姓名
};
export const commonData1 = (state = defaultStateCommonData1 , action = {}) => {
	switch(action.type){
		case home.SAVECOMMONDATA1:
			return {...state, ...{[action.datatype]: action.value}};
		default:
			return state;
	}
}

// 全局数据2
let defaultStateCommonData2 = {
	msg3: '11', //金额
	msg4: '22', //姓名
};
export const commonData2 = (state = defaultStateCommonData2 , action = {}) => {
	switch(action.type){
		case home.SAVECOMMONDATA2:
			return {...state, ...{[action.datatype]: action.value}};
		default:
			return state;
	}
}